macos: only flush when not attached
authorChristian Hergert <chergert@redhat.com>
Mon, 8 Feb 2021 17:53:46 +0000 (09:53 -0800)
committerChristian Hergert <chergert@redhat.com>
Mon, 8 Feb 2021 19:30:05 +0000 (11:30 -0800)
This makes it so we only flush the context for the NSView, not the context
that is the center of our center of the GL context spokes.

gdk/macos/gdkmacosglcontext.c

index 8dd6bc2e005c736dfb6ac86decc44d9b34cd8f28..28b3ed7ac74de4ddfe5519128199be2d03b2c535 100644 (file)
@@ -362,7 +362,8 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
 
   GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->end_frame (context, painted);
 
-  [self->gl_context flushBuffer];
+  if (!self->is_attached)
+    [self->gl_context flushBuffer];
 }
 
 static void